import srollListItem from './srollListItem.js';

export default {
	name: 'singleAndMultItem',
	components: {
		srollListItem
	},
	props: ['iconType',
		'onPropToggle',
		'entityData',
		'showCheckbox',
		'checked',
		'showOtherProp',
		'otherProps',
		'model',
		'dataSelectDisabled',
		'dataSelectKey',
		'currentId'],
	render(createElement) {
		const { $props } = this;
		const { entityData,
			showCheckbox,
			checked,
			showOtherProp,
			otherProps,
			model,
			dataSelectDisabled,
			dataSelectKey,
			onPropToggle,
			iconType,
			currentId } = $props;

		return (
			<div class={['checkbox-item',currentId === entityData.$_selectKey?'checkbox-item-active':'',showCheckbox?'':'checkbox-item-hiden']}>
				<span data-select-key={dataSelectKey}
					data-select-disabled={dataSelectDisabled}>
					<a-checkbox
						class="checkbox-item-checkbox singleAndMult"
						value={entityData.$_selectKey}
						disabled={entityData.$_isDisabled}
						checked={checked}
						v-show={showCheckbox}
					>
					</a-checkbox>
				</span>
				<srollListItem entityData={entityData}
					showOtherProp={showOtherProp}
					otherProps={otherProps}
					smodel={model}
					iconType={iconType}
					onPropToggle={onPropToggle}>
				</srollListItem>
			</div>
		);
	}

};
